< previous page page_311 next page >

Page 311
custom property illustrates the concept of taking a programming task (combining the address fields into a string) and encapsulating it in an object (your ActiveX control). The advantage is that other programmers can use this property without having to understand the details of its implementation.
Testing the ActiveX Control
An ActiveX control eventually ends up as a compiled OCX. An OCX file, when registered on another user's machine, can be added to a Visual Basic project or displayed on a Web page in Internet Explorer. However, during the development process, you need a way to test and debug your ActiveX controls within the Visual Basic design environment. This process is slightly more complicated than debugging a Standard EXE project because you have to deal with two separate sets of running code: the ActiveX control itself and the project using the ActiveX control.
Testing with a Project Group
The easiest way to test an ActiveX component is to use a project group. Throughout most of the samples in this book, you will open projects one at a time; that is, when you choose New Project or Open Project from Visual Basic's File menu, any projects already loaded close. However, the Visual Basic development environment allows you to have multiple projects loaded simultaneously. This arrangement is known as a project group and is useful for testing ActiveX components. A typical project group consists of the ActiveX component itself plus a test project (usually a Standard EXE project).
Adding a Test Project to the Group
To begin testing the AddressCtl component, you need to add a Standard EXE project to the design environment, creating a project group. Just choose File, Add Project and then select a Standard EXE project type from the Add Project dialog box. The Project Explorer window is updated to show both projects, as shown in Figure 14.3.
tip.gif
You can quickly add a Standard EXE project by simply clicking the Add Project button.

0311-01.jpg
Figure 14.3
You can open another project
at the same time as an ActiveX
component for testing purposes.

 
< previous page page_311 next page >